import requestWithToken from "@/utils/request";
import {Role, SearchVO} from "@/typings";

export const listRole = (searchVO: SearchVO) => {
    return requestWithToken("/role/list", 'get', searchVO)
}
export const saveRole = (role: Role) => {
    return requestWithToken("/role/save", "post", role)
}
export const deleteRole = (id: string) => {
    return requestWithToken("/role/delete", "get", {id})
}
export const updateUserRole = (userId: string, roleIds: string[]) => {
    return requestWithToken('/user-role/update', 'get', {userId, roleIds: roleIds.join(',')})
}